<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head th:replace="_fragments :: head(~{::title})">
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>归档</title>
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/semantic-ui/2.2.10/semantic.min.css">
    <link rel="stylesheet" href="../static/css/me.css"> <!--引入自定义CSS样式-->
</head>
<body>
    <!--导航-->
    <nav th:replace="_fragments :: menu(4)" class="ui inverted attached segment me-padded-tb-mini me-shadow-small"> <!--引入css样式-->

    </nav>

    <!--中间内容-->
    <div class="me-container-small me-padded-tb-large">
        <div class="container">
            <!--头部-->
            <div class="ui top attached padded stackable segment"><!--attached和下面的segment相连-->
                <div class="ui two column grid middle aligned"><!--指定两行的网格，垂直方向居中-->
                    <div class="column">
                        <h3 class="ui teal header">归档</h3>
                    </div>
                    <div class="column right aligned">
                        共 <h2 class="ui orange header me-inline-block me-text-thin" th:text="${blogCount}"> 14 </h2> 篇 <!--h为块，自动换行，需要自己写样式-->
                    </div>
                </div>
            </div>

            <!--按年份归档-->
            <th:block th:each="item: ${archiveMap}">
                <h2 class="ui center aligned header" th:text="${item.key}">2020</h2>
                <div class="ui fluid vertical menu">

                        <a href="#" th:href="@{/blog/{id}(id=${blog.id})}" target="_blank" class="item" th:each="blog: ${item.value}">
                            <span><!--两个合成一个-->
                                <i class="teal medium icon"></i><span th:text="${blog.title}">关于刻意练习的清单</span>
                                <div class="ui me-text-thin teal basic left pointing label" th:text="${#dates.format(blog.updateTime, 'MMMdd')}">09.03</div>
                            </span>
                            <span style="float: right">
                                <div class="ui orange basic left pointing label right aligned" th:text="${blog.flag}">原创</div>
                            </span>
                        </a>



                </div>
            </th:block>
        </div>
    </div>

    <!--底部footer-->
    <footer th:replace="_fragments :: footer" class="ui inverted vertical segment me-padded-tb-max"><!--vertical消除圆角，用attached好像也行-->

    </footer>
    <th:block th:replace="_fragments :: script"></th:block>

    <script>
        $('.menu.toggle').click(function () {
            $('.m-item').toggleClass('me-mobile-hide');/*toggleClass，取反函数*/
        });

        //要加后面的""里的地址
        $('#newBlog-container').load(/*[[@{/footer/newBlogs}]]*/"/footer/newBlogs");
    </script>
</body>
</html>